<?php
session_start();

//ini_set
ini_set('magic_quotes_gpc', '0');
ini_set('mbstring.internal_encoding', 'UTF-8');
ini_set('mbstring.http_input', 'pass');
ini_set('mbstring.http_output', 'pass');
ini_set('mbstring.substitute_character ', 'none');
ini_set('mbstring.detect_order' ,'UTF-8,SJIS,EUC-JP,JIS,ASCII');
ini_set('safe_mode', '0');

//set language
@$language = !empty($_GET["lang"]) ? strip_tags($_GET["lang"]) : $_SESSION["lang"];
if($language == "en"){
	$_SESSION["lang"] = "en";	
}else{
	$_SESSION["lang"] = "vi";
}
@$language = $_SESSION["lang"];

$dir = realpath(dirname(__FILE__));
@include_once("{$dir}/function.php");
@include_once("{$dir}/setting.php");
@include_once "{$dir}/lang/{$language}.php";
$langDB = ucfirst($language);

//query string
/*
$queryString = $_SERVER["QUERY_STRING"];
if(!stristr($queryString, 'lang') === FALSE){
	$queryString = substr(stristr($queryString, '&'), 1);
}
$connector = "&".$queryString;

/*
//get page url
$pageURL = 'http';
if($_SERVER["HTTPS"] == "on"){
	$pageURL .= "s";
}
$pageURL .= "://";
if($_SERVER["SERVER_PORT"] != "80"){
	$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}else{
	$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
/**/

?>